package com.nonsense.textsummary

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.material.LinearProgressIndicator
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource

enum class LoadingState {
    idle, isLoading, success, failure
}

@Composable
fun DefaultLoading() {
    LinearProgressIndicator()
}

@Composable
fun DefaultFailure(error: Throwable, retry: () -> Unit) {
    Text(
        text = stringResource(id = R.string.loading_error),
        modifier = Modifier.clickable(onClick = retry)
    )
}
